package com.shouhe.mysap.controller.tech;

import com.shouhe.mysap.common.PageResult;
import com.shouhe.mysap.common.status.SaleStatus;
import com.shouhe.mysap.entity.SaleItem;
import com.shouhe.mysap.service.SaleItemService;
import com.shouhe.mysap.util.PageResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

/**
 * @author 守鹤
 * @create 2020-06-04 19:46
 */
@RestController
@RequestMapping("/tech-item")
public class TechItemsController {

    @Autowired
    private SaleItemService saleItemService;

    /**
     * 根据条件得到全部的技术需要确认的销售商品
     * @param page
     * @param rows
     * @param techGroup
     * @param itemCode
     * @param itemName
     * @return
     */
    @RequestMapping("/getTechItems")
    public PageResult getTechItems(@RequestParam(defaultValue = "1") Integer page,@RequestParam(defaultValue = "10") Integer rows,String techGroup,String itemCode,String itemName) {
        HashMap<String, Object> map = new HashMap<>();
        map.put("tech_group",techGroup);
        map.put("item_code",itemCode);
        map.put("item_name",itemName);
        map.put("status",SaleStatus.SALE_ITEM_TECH_COMFIRM);
        return PageResultUtil.getPageResultAllEq(page,rows,saleItemService,map);
    }



}
